Example: 01-Camera/03-Event-Cameras/02-Genx320/genx320_color_dark with_tracking.py

# 本作品采用MIT许可证授权。
# 版权所有 (c) 2013-2024 OpenMV LLC。保留所有权利。
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# 此示例展示了如何使用Prophesee的genx320事件相机。

import sensor
import image
import time

sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE)  # 必须始终为灰度。
sensor.set_framesize(sensor.B320X320)  # 必须始终为320x320。
sensor.set_color_palette(image.PALETTE_EVT_DARK)

clock = time.clock()

while True:
    clock.tick()

    img = sensor.snapshot()
    # img.median(1) # 噪声清理。

    blobs = img.find_blobs(
        [(10, 20, -10, 10, -20, 0)], invert=True, pixels_threshold=10, area_threshold=100, merge=True
    )

    for blob in blobs:
        img.draw_rectangle(blob.rect(), color=(255, 0, 0))
        img.draw_cross(blob.cx(), blob.cy(), color=(0, 255, 0))

    print(clock.fps())

results matching ""

    No results matching ""